﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace YArchitech.Revit
{
	public static class RevitFamilyExtension
	{
		public static List<FamilySymbol> GetSymbols(this Family family)
		{
			List<FamilySymbol> list = new List<FamilySymbol>();
			foreach (ElementId elementId in family.GetFamilySymbolIds())
			{
				FamilySymbol item = family.Document.GetElement(elementId) as FamilySymbol;
				list.Add(item);
			}
			return list;
		}

		public static List<ElementId> GetSymbolIds(this Family family)
		{
			List<ElementId> list = new List<ElementId>();
			foreach (FamilySymbol familySymbol in family.GetSymbols())
			{
				if (familySymbol != null)
				{
					list.Add(familySymbol.Id);
				}
			}
			return list;
		}
	}
}
